package it.traveldream.entities;

import java.io.Serializable;
import java.lang.String;
import java.util.List;

import javax.persistence.*;

/**
 * Entity implementation class for Entity: Group
 *
 */
@Entity
@Table(name="UserType")
public class UserType implements Serializable {

	   
	@Id
	private String name;
	private static final long serialVersionUID = 1L;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	@JoinTable(
			name="UsersTypes",
			joinColumns = {@JoinColumn(name = "USERTYPE", referencedColumnName = "NAME")},
			inverseJoinColumns = {@JoinColumn(name = "USER", referencedColumnName = "USERNAME", unique = true)}
			)
	private List<User> users;
	
	public UserType() {
		super();
	}   
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}
	public List<User> getUsers() {
		return this.users;
	}
	public void setUsers(List<User> users) {
		this.users = users;
	}
   
}
